var o = new Object;

var load = function () {

    console.log(123);
    var a = [33.33, 1, 2, 3];
    console.log(Number(null));//0
    console.log(Boolean(undefined));//false
    console.log("a的length:" + a.length);
    console.log("parseInt:" + parseInt(a));

    console.log("'b'<3:" + ("b" < 3));

    console.log("asdfasdfasdf".toLowerCase());

    var ss = "LJFGDSLENSDFL";
    with (ss) {
        console.log(toLowerCase());

    }

    class User {
        constructor(name, age) {
            this.name = name;
            this.age = age;
        }

        toString() {
            return "(" + this.name + "," + this.age + ")";
        }

        getName() {
            return this.name;
        }
    }

    with (new User("赵信", 1)) {
        console.log(toString());
        console.log(getName());
    }

    console.log(new User("盖伦", 123));


    /* var s = prompt("请输入用户名");
    if(confirm("确认")){
        console.log(new User(s,s).toString());
    } */

    var num = -1;
    num = (num >> 1);

    var num2 = new Number(), str = new String(), b = new Boolean();
    num2 = 3;
    str = "this is String"
    b = true;
    console.log(num2 + "," + str + "," + b);

    var a123 = [2, 5, 6, 231, 98, 21, 65, 86, 53];
    console.log(a123);
    console.log(a123.reverse());//颠倒
    console.log(a123.sort());

    let dpi = Math.pow(1920, 2) + Math.pow(1080, 2);

    console.log(dpi);

    console.log(Math.pow(dpi, 0.5) / 5);


    //id style onclick
    var div = document.getElementById('id')
    div.style.backgroundColor = '#D0E8FF';
    div.style.width = '235px';
    div.style.height = '165px';
    div.style.borderRadius = "15px";
    div.style.marginBottom = "10px";
    //div.style.backgroundImage='url(img/bak.jpg)';
    div.style.borderStyle = '1px';

    /* div.css("border-radius","15px"); */
    div.onclick = function () {
        console.log("点击div")
    };
    div.onmousemove = function () {
        console.log("移动鼠标")
    };
    div.onmouseover = function () {
        console.log("In....");
        div.style.backgroundColor = '#DEEBF9'
    };
    div.onmouseout = function () {
        console.log("Out....");
        div.style.backgroundColor = '#D0E8FF'
    };
    div.onmousedown = function () {
        console.log("Pressed...");
    };
    div.onmouseup = function () {
        console.log("Released...");
    };
    div.ondblclick = function () {
        console.log("双击...")
    };

    console.log($('#id'));


    console.log(div);


    var input = document.getElementById('input');
    input.onblur = function () {
        console.log("失去焦点")
    };
    input.onfocus = function () {
        console.log("获取焦点")
    };
    input.onchange = function () {
        console.log(input.value)
    };//失去焦点时调用


    var [i, j] = [1, 'sdfsdf'];
    console.log(i);
    var i;
    console.log(j.startsWith('sdf'));
    console.log(j.endsWith('sdf'));
    console.log(j.includes('sdf'));
    console.log('淵'.codePointAt(0));

    console.log(String.fromCodePoint('28149'));

    console.log('\u01D1');

    console.log("========================================");
    var text = String.fromCodePoint(0x22545);
    console.log(text.length);

    for (let i = 0; i < text.length; i++) {
        console.log(text[i]);
    }

    for (let i of text) {
        console.log(i);
    }
    for (let i in text) {
        console.log(i);
    }

    var name = '模板';
    name = function () {
        console.log("模板function...");
        return "模板function";
    };
    var strg = `这是一个 ${name()} 字符串`;
    div.append(strg);
    console.log(strg);


    let str1 = 'return ' + '`Hello ${name}!`';
    let func = new Function('name', str1);
    console.log(func('Jack')); //

    function f1(i) {
        console.log("1:" + i);
    }

    function f2(i, j, k) {
        console.log("2:" + i + j + k);
    }

    f1();
    f1("光辉");
    f2(1, '-', '00')

    var rrr = 'sdfasfasd';
    console.log(rrr.replace('s', 'D'));

    /* var arr = ['赵信','盖伦','易']
    function readA(a){
        for(let i of a)
            console.log(i);
    }
    readA(arr);
    console.log(arr.toString()); */

    /* var str5 = 'Hello World! Hello Java!';
    var fun1 = function(a){
        if(a.match("s"))
            return true;
        else
            return false;
    }
    console.log(fun1(str5)); */

    var x1 = (x) => x * 8;
    console.log(x1(8));
    console.log(isFinite(100000 / 0));

    console.log(Math.pow(2, 1 / 3));
    console.log(Math.trunc(3.1415));

    var inVN = (x) => Math.sign(x);

    console.log(inVN(123) + "," + inVN(-12) + "," + inVN(0) + "," + Math.sign(-0) + "," + inVN('sdf'));

    console.log('==================================');

    console.log(isNaN('15'));
    console.log(Number.MAX_VALUE);
    console.log(new Number(1158).toPrecision(2));

    var boo = false;
    console.log(typeof boo + ":" + boo.valueOf());

    (function () {
        'use strict';
        console.log(Number.isNaN(true));
        var nu = '12'.valueOf();
        console.log(nu);
        console.log(Number.EPSILON.toFixed(50));//极小常量

        console.log(Math.floor(8.95));//y<=x
        console.log(Math.floor(-0.15))
        console.log(Math.min(6, 2));
        console.log(Math.trunc(0.125));
        console.log(true === 1);
    })();


    console.log(Math.pow(7, 1 / 3));
    console.log(Math.fround(1.337));
    console.log(Math.cbrt(7));
    console.log('流'.charCodeAt(0));
    console.log(String.concat(String.fromCharCode(27969), 'lkjl'));
    console.log('asdfasgdfgdas'.slice(3, 5));
    console.log('asdfasgdfgdas'.substr(3, 5));
    console.log('asdfasgdfgdas'.substring(3, 5));
    console.log('aawerwer'.padEnd(5, 'sjy'));
    console.log(new Date().toTimeString());
    /* var num3 = 66.1321541;
    console.log(num3.toFixed(3)); */

    var d = new Date("1992/1/15");
    /* d.setDate(18);
    d.setFullYear(1992);
    d.setMonth(1); */
    console.log(d.toLocaleString());

    console.log([1, 4, -5, 10].find((n) => n < 0));
    console.log(['a', 'b', 'c', 'd', 'e'].fill('kk', 2));

    (function () {
        'use strict';
        console.log(-14 >> 2);
    })();

    let dqrcode = document.getElementById('qrcode');

    $('#qrcode').qrcode({
        width: 100,
        height: 100,
        text: 'www.baidu.com'
    });
    console.log($('#qrcode'));

    (function () {
        'use strict';
        console.log('...........');
    })();


    nizi(2);

    console.log(ni);
}

function nizi(a) {
    var ni = a + 2;
    console.log(ni);
}





